<?php
class Logout extends MY_Controller {
    public function __construct() {
        parent::MY_Controller();

        $this->load->helper(array('form','url', 'language'));
        
        $this->lang->load('login');
        $this->lang->load('welcome');
    }

	public function index() {
		Current_User::logout();
		
        $this->session->set_userdata('id', '');
        $this->session->set_userdata('roles', '');
		$this->session->sess_destroy();
		//$this->render('login/logout');
		
		$this->redirect('welcome', "You've successfuly logged out.");
	}

}
